import React, { useState } from "react";
import { Input, Space, Select } from "antd";
const { Search } = Input;
const { Option } = Select;
export default function (props) {
    let [type, setType] = useState("name");
    const handleChange = (value) => {
        setType(value);
    };
    const onSearch = (value) => {
        props.show({type,value});
    };
    return (
        <div>
            <Input.Group compact>
                <Select defaultValue="name" style={{ width: 120 }} onChange={handleChange}>
                    <Option value="name">优惠券名称</Option>
                    <Option value="coupons">活动</Option>
                    <Option value="func">折扣</Option>
                    <Option value="date">日期</Option>
                    <Option value="intro">规则</Option>
                </Select>
                <Search
                    style={{ width: "30%" }}
                    placeholder="搜索值"
                    onSearch={onSearch}
                    enterButton
                />
            </Input.Group>
        </div>
    );
}
